WIP: BlockInterval support for hash ranges #728
Draft
+433
−271
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WIP
Relates to #287.
Refactored
BlockInterval::new()
to allow for the simplest support for block hash ranges in the runtime and associated scripts.Changes
BlockInterval
to only containu64
ranges, which seems like an appropriate invariant for the type and also simplifies subsequent usage (no need to match onSingleBlock
).This approach requires flag usage to be in the form of
--start-block [num|hash] --end-block [num|hash]
. An alternative approach would be to modify the CLI flags to be of typeRange<u64>
separately to the block hash flags, but that feels like a messier approach.The current approach is not without its own UX issues. For example, to specify a single block, you need to use both start/end flags where the input value is identical. This could be addressed with a separate flag without being too messy, however.
TODO: